﻿namespace OutLook.Model.Domains
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.Serialization;
    using System.Data.SqlTypes;
    using OutLook.Model.Infrastructure;

    [DataContract]
    public class Technology
    {
        #region Constructors

        /// <summary>
        /// Full constructor for Technology
        /// </summary>
        /// <param name="blastOutlay">Consumption of blast (m3/min)</param>
        /// <param name="blastPressure">Pressure of blast (ati)</param>
        /// <param name="blastTemperature">Temperature of blast (C)</param>
        /// <param name="blastO2Content">O2 content in blast (%)</param>
        /// <param name="blastWet">Wet of blast (gr/m3)</param>
        /// <param name="topGasPressure">Pressure of top gas (ati)</param>
        /// <param name="topGasTemperature">Temperature of top gas (C)</param>
        /// <param name="topGasCO">CO content in top gas (%)</param>
        /// <param name="topGasCO2">CO2 content in top gas (%)</param>
        /// <param name="steamConsumption">Consumption of steam (t/h)</param>
        /// <param name="naturalGasOutlay">Consumption of natural gas (m3/min)</param>
        /// <param name="naturalGasCG">CG content in natural gas (%)</param>
        /// <param name="naturalGasHG">HG content in natural gas (%)</param>
        /// <param name="naturalGasOG">OG content in natural gas (%)</param>
        /// <param name="naturalGasNG">NG content in natural gas (%)</param>
        /// <param name="tuyeresQuantity">Quantity of tuyeres</param>
        /// <param name="tuyeresDiameter">Diameter of tuyeres (cm)</param>
        /// <param name="cokeSampleM25">Sample of coke which has diametr 25mm</param>
        /// <param name="cokeSampleM10">Sample of coke which has diametr 10mm</param>
        /// <param name="cokeDiameter">Diameter of coke (cm)</param>
        /// <param name="cokeDensity">Density of coke (cm)</param>
        private Technology(double blastOutlay, double blastPressure, double blastTemperature, double blastO2Content,
           double naturalWet, double topGasPressure, double topGasTemperature, double topGasCO, double topGasCO2,
            double steamOutlay, double naturalGasOutlay, double naturalGasCG, double naturalGasHG, double naturalGasOG,
            double naturalGasNG, int tuyeresQuantity, int tuyeresDiameter, double cokeSampleM25, double cokeSampleM10,
            double cokeDiameter, double cokeDensity)
        {
            BlastOutlay = blastOutlay;
            BlastPressure = blastPressure;
            BlastTemperature = blastTemperature;
            BlastO2Content = blastO2Content;
            NaturalWet = naturalWet;
            TopGasPressure = topGasPressure;
            TopGasTemperature = topGasTemperature;
            TopGasCO = topGasCO;
            TopGasCO2 = topGasCO2;
            SteamOutlay = steamOutlay;
            NaturalGasOutlay = naturalGasOutlay;
            NaturalGasCG = naturalGasCG;
            NaturalGasHG = naturalGasHG;
            NaturalGasOG = naturalGasOG;
            NaturalGasNG = naturalGasNG;
            TuyeresQuantity = tuyeresQuantity;
            TuyeresDiameter = tuyeresDiameter;
            CokeSampleM25 = cokeSampleM25;
            CokeSampleM10 = cokeSampleM10;
            CokeDiameter = cokeDiameter;
            CokeDensity = cokeDensity;
        }

        #endregion

        #region Factory Method

        /// <summary>
        /// Create Tehnplogy
        /// </summary>
        /// <param name="blastOutlay">Consumption of blast (m3/min)</param>
        /// <param name="blastPressure">Pressure of blast (ati)</param>
        /// <param name="blastTemperature">Temperature of blast (C)</param>
        /// <param name="blastO2Content">O2 content in blast (%)</param>
        /// <param name="blastWet">Wet of blast (gr/m3)</param>
        /// <param name="topGasPressure">Pressure of top gas (ati)</param>
        /// <param name="topGasTemperature">Temperature of top gas (C)</param>
        /// <param name="topGasCO">CO content in top gas (%)</param>
        /// <param name="topGasCO2">CO2 content in top gas (%)</param>
        /// <param name="steamConsumption">Consumption of steam (t/h)</param>
        /// <param name="naturalGasOutlay">Consumption of natural gas (m3/min)</param>
        /// <param name="naturalGasCG">CG content in natural gas (%)</param>
        /// <param name="naturalGasHG">HG content in natural gas (%)</param>
        /// <param name="naturalGasOG">OG content in natural gas (%)</param>
        /// <param name="naturalGasNG">NG content in natural gas (%)</param>
        /// <param name="tuyeresQuantity">Quantity of tuyeres</param>
        /// <param name="tuyeresDiameter">Diameter of tuyeres (cm)</param>
        /// <param name="cokeSampleM25">Sample of coke which has diametr 25mm</param>
        /// <param name="cokeSampleM10">Sample of coke which has diametr 10mm</param>
        /// <param name="cokeDiameter">Diameter of coke (cm)</param>
        /// <param name="cokeDensity">Density of coke (cm)</param>
        /// <returns>Tehnology object</returns>
        public static Technology Create(double blastOutlay, double blastPressure, double blastTemperature, double blastO2Content,
           double blastWet, double topGasPressure, double topGasTemperature, double topGasCO, double topGasCO2,
            double steamConsumption, double naturalGasOutlay, double naturalGasCG, double naturalGasHG, double naturalGasOG,
            double naturalGasNG, int tuyeresQuantity, int tuyeresDiameter, double cokeSampleM25, double cokeSampleM10,
            double cokeDiameter, double cokeDensity)
        {
            if (blastOutlay != 0 && blastPressure != 0 && blastTemperature != 0 &&
                blastO2Content != 0 && blastWet != 0 && topGasPressure != 0 &&
               topGasTemperature != 0 && topGasCO != 0 && topGasCO2 != 0 &&
               naturalGasOutlay != 0 && naturalGasCG != 0 && naturalGasHG != 0 && naturalGasOG != 0 &&
               naturalGasNG != 0 && tuyeresQuantity != 0 && tuyeresDiameter != 0 && cokeSampleM25 != 0 &&
               cokeSampleM10 != 0 && cokeDiameter != 0 && cokeDensity != 0)
                return new Technology(blastOutlay, blastPressure, blastTemperature, blastO2Content,
            blastWet, topGasPressure, topGasTemperature, topGasCO, topGasCO2,
             steamConsumption, naturalGasOutlay, naturalGasCG, naturalGasHG, naturalGasOG,
             naturalGasNG, tuyeresQuantity, tuyeresDiameter, cokeSampleM25, cokeSampleM10,
             cokeDiameter, cokeDensity);

            return null;
        }
        #endregion

        #region Properties

        /// <summary>
        /// Consumption of blast (m3/min)
        /// </summary>
        [DataMember]
        public double BlastOutlay { get; set; }

        /// <summary>
        /// Pressure of blast (ati)
        /// </summary>
        [DataMember]
        public double BlastPressure { get; set; }

        /// <summary>
        /// Temperature of blast (C)
        /// </summary>
        [DataMember]
        public double BlastTemperature { get; set; }

        /// <summary>
        /// O2 content in blast (%)
        /// </summary>
        [DataMember]
        public double BlastO2Content { get; set; }

        /// <summary>
        /// Wet of blast (gr/m3)
        /// </summary>
        [DataMember]
        public double NaturalWet { get; set; }

        /// <summary>
        /// Pressure of top gas (ati)
        /// </summary>
        [DataMember]
        public double TopGasPressure { get; set; }

        /// <summary>
        /// Temperature of top gas (C)
        /// </summary>
        [DataMember]
        public double TopGasTemperature { get; set; }

        /// <summary>
        /// CO content in top gas (%)
        /// </summary>
        [DataMember]
        public double TopGasCO { get; set; }

        /// <summary>
        /// CO2 content in top gas (%)
        /// </summary>
        [DataMember]
        public double TopGasCO2 { get; set; }

        /// <summary>
        /// Consumption of steam (t/h)
        /// </summary>
        [DataMember]
        public double SteamOutlay { get; set; }

        /// <summary>
        /// Consumption of natural gas (m3/min)
        /// </summary>
        [DataMember]
        public double NaturalGasOutlay { get; set; }

        /// <summary>
        /// CG content in natural gas (%)
        /// </summary>
        [DataMember]
        public double NaturalGasCG { get; set; }

        /// <summary>
        /// HG content in natural gas (%)
        /// </summary>
        [DataMember]
        public double NaturalGasHG { get; set; }

        /// <summary>
        /// OG content in natural gas (%)
        /// </summary>
        [DataMember]
        public double NaturalGasOG { get; set; }

        /// <summary>
        /// NG content in natural gas (%)
        /// </summary>
        [DataMember]
        public double NaturalGasNG { get; set; }

        /// <summary>
        /// Quantity of tuyeres
        /// </summary>
        [DataMember]
        public int TuyeresQuantity { get; set; }

        /// <summary>
        /// Diameter of tuyeres (cm)
        /// </summary>
        [DataMember]
        public double TuyeresDiameter { get; set; }

        /// <summary>
        /// Sample of coke which has diametr 25mm
        /// </summary>
        [DataMember]
        public double CokeSampleM25 { get; set; }

        /// <summary>
        /// Sample of coke which has diametr 10mm
        /// </summary>
        [DataMember]
        public double CokeSampleM10 { get; set; }

        /// <summary>
        /// Diameter of coke (cm)
        /// </summary>
        [DataMember]
        public double CokeDiameter { get; set; }

        /// <summary>
        /// Density of coke (cm)
        /// </summary>
        [DataMember]
        public double CokeDensity { get; set; }

        /// <summary>
        /// Theoretical temperature of burning (calculation property)
        /// </summary>
        [DataMember]
        public double Ttb { get; set; }

        /// <summary>
        /// Length of tuyere zone (calculation property)
        /// </summary>
        [DataMember]
        public double Ltz { get; set; }

        /// <summary>
        /// The power of top gas using (calculation property)
        /// </summary>
        [DataMember]
        public double Eta { get; set; }

        #endregion
    }
}
